package com.ch05.controller;

import com.ch05.controller.vo.ResultVO;
import com.ch05.entity.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName UserController
 * @Description TODO
 * @Author Kx
 * @Date 2025/5/13 11:12
 * @Version 1.0
 */
// 新版本加入了@RestController注解,不需要在每个方法上显示标注@ResponseBody注解
@RestController
public class UserController extends BaseController{
    @GetMapping("/user")
    public ResultVO<User> getUser() {
        User user = new User();
        user.setUid(1);
        user.setUsername("张三");
        user.setAge(18);
        return success(user);
    }
}
